<html>
<head><meta charset="utf-8"><title>associated type where clauses · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/associated.20type.20where.20clauses.html">associated type where clauses</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240762544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/associated%20type%20where%20clauses/near/240762544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/associated.20type.20where.20clauses.html#240762544">(May 30 2021 at 16:13)</a>:</h4>
<p>try_trait_v2 currently doesn't work in rust-analyzer. The reason seems to be that we include the where clauses of the trait in the where clauses for its associated type, which leads to a cycle that otherwise wouldn't happen (the <code>Normalize</code> rule requires the where clauses of the associated type, but not the trait). Are the <code>where_clauses</code> in <code>AssociatedTyDatum</code> not supposed to include the trait's where clauses? See <a href="https://github.com/rust-analyzer/rust-analyzer/issues/9052#issuecomment-850886436">this Chalk test</a></p>



<a name="240762800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/associated%20type%20where%20clauses/near/240762800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/associated.20type.20where.20clauses.html#240762800">(May 30 2021 at 16:18)</a>:</h4>
<p>(and if they aren't, why is it correct to only include the where clauses of the associated type in the <code>Normalize</code> rule?)</p>



<a name="241074745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/associated%20type%20where%20clauses/near/241074745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/associated.20type.20where.20clauses.html#241074745">(Jun 01 2021 at 20:58)</a>:</h4>
<p>hmm</p>



<a name="241074763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/associated%20type%20where%20clauses/near/241074763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/associated.20type.20where.20clauses.html#241074763">(Jun 01 2021 at 20:59)</a>:</h4>
<p>I think they are there intentionally</p>



<a name="241074903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/associated%20type%20where%20clauses/near/241074903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/associated.20type.20where.20clauses.html#241074903">(Jun 01 2021 at 21:00)</a>:</h4>
<p>the idea is that we can only normalize if we know the impl applies-- or, hmm, of the <em>trait</em></p>



<a name="241074911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/associated%20type%20where%20clauses/near/241074911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/associated.20type.20where.20clauses.html#241074911">(Jun 01 2021 at 21:00)</a>:</h4>
<p>well, then, if we know it's wel formed</p>



<a name="241074921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/associated%20type%20where%20clauses/near/241074921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/associated.20type.20where.20clauses.html#241074921">(Jun 01 2021 at 21:00)</a>:</h4>
<p>this is connected to implied bounds, probably</p>



<a name="241149290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/associated%20type%20where%20clauses/near/241149290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/associated.20type.20where.20clauses.html#241149290">(Jun 02 2021 at 13:35)</a>:</h4>
<p>hmm probably. I don't know much about implied bounds, I guess their behavior might be different for bounds/where clauses of the _associated type_ vs. the trait?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>